import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import './index.css'
import { createPinia } from 'pinia'

import { DropdownMenu, DropdownItem, DatetimePicker, Search, Divider, Lazyload, Loading, Toast, ImagePreview, Popup, Button, Slider, NoticeBar, List } from 'vant'

const app = createApp(App)

app.use(createPinia())
app.use(router)

app.use(Divider)
app.use(Lazyload)
app.use(Loading)
app.use(Toast)
app.use(ImagePreview)
app.use(Popup)
app.use(Button)
app.use(Slider)
app.use(NoticeBar)
app.use(Search)
app.use(List)
app.use(DatetimePicker)
app.use(DropdownMenu)
app.use(DropdownItem)


Toast.setDefaultOptions({ duration: 1000 });

router.afterEach((to, from) => {
    if (from.matched.length === 0) {
        to.meta.transitionName = ''
    } else {
        to.meta.transitionName = 'slide-right'
    }
})

app.mount('#app')

